﻿using System;
using System.Data.Entity.ModelConfiguration;

namespace NTQOnlineExam.Services.EntityFW.Entity
{
    public class OrderDetail
    {
        public Guid Id { get; set; }
        public Guid OrderId { get; set; }
        public int TermId { get; set; }
        public string TermName { get; set; }
        public decimal? Price { get; set; }
        public float? TaxPercent { get; set; }
        public decimal? Tax { get; set; }
        public virtual Order Order { get; set; }
    }

    public class OrderDetailMap : EntityTypeConfiguration<OrderDetail>
    {
        public OrderDetailMap()
        {
            this.HasKey(t => t.Id);
            this.ToTable("OrderDetail");
            //this.HasRequired(e => e.Order).WithMany().Map(p => p.MapKey("OrderId")).WillCascadeOnDelete(false);
        }
    }
}